﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using RestSharp;
using sixgod.Base.Controllers;

namespace sixgod.Module.SystemCore.Controllers.System;

[Route("[Controller]"),AllowAnonymous]
public class SsoController:BaseController
{
    private IConfiguration _configuration;

    public SsoController(IConfiguration configuration)
    {
        _configuration = configuration;
    }

    [HttpGet("{token}")]
    public async Task<IActionResult> RefreshToken(string token)
    {
        var client = new RestClient(_configuration["SSO:Url"]);
        var request = new RestRequest("/SSO");
        request.AddBody(token);
        var response = await client.PostAsync(request);
        if (response.IsSuccessStatusCode)
        {
            
        }
    }
}